<%@ page language="java" pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html:html lang="true">
<head>
	<html:base />

	<title>${popWindowForm.windowTitle}</title>

	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="expires" content="0" />
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
	<meta http-equiv="description" content="This is my page" />
	<script type="text/javascript" src="<%=request.getContextPath()%>/js/base.js"></script>
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/base.css" />

</head>

<body class="body_right">
	<html:form action="/pop_window.do?method=popWindow&searchFlag=1">
		<html:hidden property="windowTitle"/>
		<html:hidden property="windowName"/>
		<html:hidden property="dto"/>
		<html:hidden property="formName"/>
		<html:hidden property="pageProp"/>
		<html:hidden property="sqlMapId"/>
		<html:hidden property="countSqlMapId"/>
		<html:hidden property="searchProp"/>
		<html:hidden property="searchPropDisp"/>
		<html:hidden property="resultProp"/>
		<html:hidden property="resultPropDisp"/>
		<html:hidden property="writeBackProp"/>
		
		<table class="title1">
			<tr>
				<td class="title1_td1">
					<bean:write name="popWindowForm" property="windowTitle" />
				</td>
				<td class="title1_td2">
					<input class="button_2zi" type="button" value="选 定" onclick="dosubmit(this.form, '../pop_window.do?method=popWindowDo');"/>
				</td>
			</tr>
		</table>
		
		<!-- 显示查询条件  -->
		<table class="table1">
			<bean:define id="searchPropDispArr" name="popWindowForm" property="searchPropDispArr" type="java.lang.String[]" />
			<logic:iterate id="searchProp" name="popWindowForm" property="searchPropArr" indexId="indexId" type="java.lang.String">
				<%
					// 因为1行有2个查询条件
					// 所以偶数个时，开始新的一行
					// 所以奇数个时，结束原有的一行  
					String addOrEven = Integer.toString(indexId % 2); //0为偶数，1为奇数
				%>
				<logic:equal name="addOrEven" value="0">
					<%="<tr>" %>
				</logic:equal>
				
				<td align="right">
					<%=searchPropDispArr[indexId]%>
				</td>
				<td>
					<input type="text" name="${searchProp}" size="10" value="<%=request.getParameter(searchProp)==null?"":request.getParameter(searchProp)%>" />
				</td>
				
				<logic:equal name="addOrEven" value="1">
					<%="</tr>" %>
				</logic:equal>
			</logic:iterate>
			
			<tr>
				<td>
				</td>
				<td>
				</td>
				<td>
				</td>
				<td>
					<input class="button_2zi" type="submit" value="查 询"/>
				</td>
			</tr>
		</table>
		<!-- End-显示查询条件  -->
		
		<div class="line1"></div>
		
		<!-- 显示查询结果  -->
		<table class="table2">
			<!-- 表头 -->
			<tr>
				<th class="table2_title" width="5%">
					
				</th>
				<bean:define id="resultPropDispArr" name="popWindowForm" property="resultPropDispArr" type="java.lang.String[]"></bean:define>
				<% int width = 95 / resultPropDispArr.length; %>
				<logic:iterate id="resultPropDisp" name="popWindowForm" property="resultPropDispArr" indexId="indexId">
					<logic:notEqual name="indexId" value="${fn:length(resultPropDispArr)-1}">
						<th class="table2_title" width="<%=width%>%">
							<bean:write name="resultPropDisp"/>
						</th>
					</logic:notEqual>
					<logic:equal name="indexId" value="${fn:length(resultPropDispArr)-1}">
						<th>
							<bean:write name="resultPropDisp"/>
						</th>
					</logic:equal>
				</logic:iterate>
			</tr>
			
			<!-- 表内容 -->
			<logic:iterate id="result" name="resultList" type="java.util.Map">
				<tr>
					<td width="5%">
						<input type="radio" name="writeBackVal" value="${result.writeBackValue}" />
					</td>
					<logic:iterate id="resultProp" name="popWindowForm" property="resultPropArr">
						<td>
							<%=result.get(resultProp)%>
						</td>
					</logic:iterate>
				</tr>
			</logic:iterate>
		</table>
		<!-- End-显示查询结果  -->
		<jsp:include page="../page_info/page_info.jsp"></jsp:include>
	</html:form>
</body>
</html:html>
